﻿﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;
using Fcdbas.Core;
using Fcdbas.Core.Configuration;
using Fcdbas.Core.DataAccess;


namespace Fcdbas.CustomerOrder
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [Description("")]
    [BindTable("customer_order_line", Description = "", ConnName = "", DbType = DatabaseType.MySql)]
    public class customer_order_line : Entity<customer_order_line>,Icustomer_order_line
    {
        #region 属性
 
        private String _order_no;

        /// <summary>FLAGS=KMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=订单号^LENGTH=20^KEYS=OrderNo^REF=CustomerOrder^VIEW=CUSTOMER_ORDER^OPTION=^ARG=^</summary>
        [DisplayName("订单号")]
        [Description("FLAGS=KMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=订单号^LENGTH=20^KEYS=OrderNo^REF=CustomerOrder^VIEW=CUSTOMER_ORDER^OPTION=^ARG=^")]
        [DataObjectField(false, false, false, 20)]
        [BindColumn(1, "order_no",  null, "varchar(20)", 0, 0, false)]

        public virtual String order_no

        {
            get { return _order_no; }
            set { if (OnPropertyChanging(__.order_no, value)) { _order_no = value; OnPropertyChanged(__.order_no); } }
        }

 
        private Int32? _line_no;

        /// <summary>FLAGS=K-I-L^FORMAT=Int^DATATYPE=Number^PROMPT=行号^LENGTH=4^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("行号")]
        [Description("FLAGS=K-I-L^FORMAT=Int^DATATYPE=Number^PROMPT=行号^LENGTH=4^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, false, 10)]
        [BindColumn(2, "line_no",  "0", "int(11)", 10, 0, false)]

        public virtual Int32? line_no

        {
            get { return _line_no; }
            set { if (OnPropertyChanging(__.line_no, value)) { _line_no = value; OnPropertyChanged(__.line_no); } }
        }

 
        private Int32? _rel_no;

        /// <summary>FLAGS=K-I-L^FORMAT=Int^DATATYPE=Number^PROMPT=下达号^LENGTH=4^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("下达号")]
        [Description("FLAGS=K-I-L^FORMAT=Int^DATATYPE=Number^PROMPT=下达号^LENGTH=4^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, false, 10)]
        [BindColumn(3, "rel_no",  "0", "int(11)", 10, 0, false)]

        public virtual Int32? rel_no

        {
            get { return _rel_no; }
            set { if (OnPropertyChanging(__.rel_no, value)) { _rel_no = value; OnPropertyChanged(__.rel_no); } }
        }

 
        private String _catalog_no;

        /// <summary>FLAGS=AMIUL^FORMAT=Uppercase^DATATYPE=String^PROMPT=销售件^LENGTH=35^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("销售件")]
        [Description("FLAGS=AMIUL^FORMAT=Uppercase^DATATYPE=String^PROMPT=销售件^LENGTH=35^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, false, 35)]
        [BindColumn(4, "catalog_no",  null, "varchar(35)", 0, 0, false)]

        public virtual String catalog_no

        {
            get { return _catalog_no; }
            set { if (OnPropertyChanging(__.catalog_no, value)) { _catalog_no = value; OnPropertyChanged(__.catalog_no); } }
        }

 
        private String _catalog_desc;

        /// <summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=描述^LENGTH=100^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("描述")]
        [Description("FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=描述^LENGTH=100^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, false, 100)]
        [BindColumn(5, "catalog_desc",  null, "varchar(100)", 0, 0, false)]

        public virtual String catalog_desc

        {
            get { return _catalog_desc; }
            set { if (OnPropertyChanging(__.catalog_desc, value)) { _catalog_desc = value; OnPropertyChanged(__.catalog_desc); } }
        }

 
        private Decimal? _buy_qty_due;

        /// <summary>FLAGS=AMIUL^FORMAT=Custom^DATATYPE=Number^PROMPT=数量^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("数量")]
        [Description("FLAGS=AMIUL^FORMAT=Custom^DATATYPE=Number^PROMPT=数量^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(6, "buy_qty_due",  null, "decimal(50,12)", 50, 12, false)]

        public virtual Decimal? buy_qty_due

        {
            get { return _buy_qty_due; }
            set { if (OnPropertyChanging(__.buy_qty_due, value)) { _buy_qty_due = value; OnPropertyChanged(__.buy_qty_due); } }
        }

 
        private Decimal? _buy_unit_price;

        /// <summary>FLAGS=AMIUL^FORMAT=Decimal(8,2)^DATATYPE=Number^PROMPT=单价^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("单价")]
        [Description("FLAGS=AMIUL^FORMAT=Decimal(8,2)^DATATYPE=Number^PROMPT=单价^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, false, 8)]
        [BindColumn(7, "buy_unit_price",  null, "decimal(8,2)", 8, 2, false)]

        public virtual Decimal? buy_unit_price

        {
            get { return _buy_unit_price; }
            set { if (OnPropertyChanging(__.buy_unit_price, value)) { _buy_unit_price = value; OnPropertyChanged(__.buy_unit_price); } }
        }

 
        private String _supply_code_db;

        /// <summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=供应代码^LENGTH=25^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("供应代码")]
        [Description("FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=供应代码^LENGTH=25^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, true, 25)]
        [BindColumn(8, "supply_code_db",  null, "varchar(25)", 0, 0, false)]

        public virtual String supply_code_db

        {
            get { return _supply_code_db; }
            set { if (OnPropertyChanging(__.supply_code_db, value)) { _supply_code_db = value; OnPropertyChanged(__.supply_code_db); } }
        }

 
        private String _supply_code;

        /// <summary></summary>
        [DisplayName("Code")]
        [Description("")]
        [DataObjectField(false, false, true, 255)]
        [BindColumn(9, "supply_code",  null, "varchar(255)", 0, 0, false)]

        public virtual String supply_code

        {
            get { return _supply_code; }
            set { if (OnPropertyChanging(__.supply_code, value)) { _supply_code = value; OnPropertyChanged(__.supply_code); } }
        }

 
        private String _note_text;

        /// <summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
        [DisplayName("备注")]
        [Description("FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^")]
        [DataObjectField(false, false, true, 2000)]
        [BindColumn(10, "note_text",  null, "varchar(2000)", 0, 0, false)]

        public virtual String note_text

        {
            get { return _note_text; }
            set { if (OnPropertyChanging(__.note_text, value)) { _note_text = value; OnPropertyChanged(__.note_text); } }
        }

 
        private String _objid;

        /// <summary></summary>
        [DisplayName("Objid")]
        [Description("")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(11, "objid",  null, "varchar(50)", 0, 0, false)]

        public virtual String objid

        {
            get { return _objid; }
            set { if (OnPropertyChanging(__.objid, value)) { _objid = value; OnPropertyChanged(__.objid); } }
        }

 
        private String _objversion;

        /// <summary></summary>
        [DisplayName("Objversion")]
        [Description("")]
        [DataObjectField(false, false, true, 24)]
        [BindColumn(12, "objversion",  null, "varchar(24)", 0, 0, false)]

        public virtual String objversion

        {
            get { return _objversion; }
            set { if (OnPropertyChanging(__.objversion, value)) { _objversion = value; OnPropertyChanged(__.objversion); } }
        }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// 一个索引，基类使用反射实现。
        /// 派生实体类可重写该索引，以避免反射带来的性能损耗
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.order_no : return _order_no;
                    case __.line_no : return _line_no;
                    case __.rel_no : return _rel_no;
                    case __.catalog_no : return _catalog_no;
                    case __.catalog_desc : return _catalog_desc;
                    case __.buy_qty_due : return _buy_qty_due;
                    case __.buy_unit_price : return _buy_unit_price;
                    case __.supply_code_db : return _supply_code_db;
                    case __.supply_code : return _supply_code;
                    case __.note_text : return _note_text;
                    case __.objid : return _objid;
                    case __.objversion : return _objversion;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.order_no : 
                        if(value != null)
                            _order_no = Convert.ToString(value);
                        else
                            _order_no = null;
                    break;
                    case __.line_no : 
                        if(value != null)
                            _line_no = Convert.ToInt32(value);
                        else
                            _line_no = null;
                    break;
                    case __.rel_no : 
                        if(value != null)
                            _rel_no = Convert.ToInt32(value);
                        else
                            _rel_no = null;
                    break;
                    case __.catalog_no : 
                        if(value != null)
                            _catalog_no = Convert.ToString(value);
                        else
                            _catalog_no = null;
                    break;
                    case __.catalog_desc : 
                        if(value != null)
                            _catalog_desc = Convert.ToString(value);
                        else
                            _catalog_desc = null;
                    break;
                    case __.buy_qty_due : 
                        if(value != null)
                            _buy_qty_due = Convert.ToDecimal(value);
                        else
                            _buy_qty_due = null;
                    break;
                    case __.buy_unit_price : 
                        if(value != null)
                            _buy_unit_price = Convert.ToDecimal(value);
                        else
                            _buy_unit_price = null;
                    break;
                    case __.supply_code_db : 
                        if(value != null)
                            _supply_code_db = Convert.ToString(value);
                        else
                            _supply_code_db = null;
                    break;
                    case __.supply_code : 
                        if(value != null)
                            _supply_code = Convert.ToString(value);
                        else
                            _supply_code = null;
                    break;
                    case __.note_text : 
                        if(value != null)
                            _note_text = Convert.ToString(value);
                        else
                            _note_text = null;
                    break;
                    case __.objid : 
                        if(value != null)
                            _objid = Convert.ToString(value);
                        else
                            _objid = null;
                    break;
                    case __.objversion : 
                        if(value != null)
                            _objversion = Convert.ToString(value);
                        else
                            _objversion = null;
                    break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得字段信息的快捷方式</summary>
        public class _
        {
            ///<summary>FLAGS=KMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=订单号^LENGTH=20^KEYS=OrderNo^REF=CustomerOrder^VIEW=CUSTOMER_ORDER^OPTION=^ARG=^</summary>
            public static readonly Field order_no = FindByName(__.order_no);

            ///<summary>FLAGS=K-I-L^FORMAT=Int^DATATYPE=Number^PROMPT=行号^LENGTH=4^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field line_no = FindByName(__.line_no);

            ///<summary>FLAGS=K-I-L^FORMAT=Int^DATATYPE=Number^PROMPT=下达号^LENGTH=4^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field rel_no = FindByName(__.rel_no);

            ///<summary>FLAGS=AMIUL^FORMAT=Uppercase^DATATYPE=String^PROMPT=销售件^LENGTH=35^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field catalog_no = FindByName(__.catalog_no);

            ///<summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=描述^LENGTH=100^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field catalog_desc = FindByName(__.catalog_desc);

            ///<summary>FLAGS=AMIUL^FORMAT=Custom^DATATYPE=Number^PROMPT=数量^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field buy_qty_due = FindByName(__.buy_qty_due);

            ///<summary>FLAGS=AMIUL^FORMAT=Decimal(8,2)^DATATYPE=Number^PROMPT=单价^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field buy_unit_price = FindByName(__.buy_unit_price);

            ///<summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=供应代码^LENGTH=25^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field supply_code_db = FindByName(__.supply_code_db);

            ///<summary></summary>
            public static readonly Field supply_code = FindByName(__.supply_code);

            ///<summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public static readonly Field note_text = FindByName(__.note_text);

            ///<summary></summary>
            public static readonly Field objid = FindByName(__.objid);

            ///<summary></summary>
            public static readonly Field objversion = FindByName(__.objversion);

            static Field FindByName(String name) { return Meta.Table.FindByName(name); }
        }

        /// <summary>取得字段名称的快捷方式</summary>
        class __
        {
            ///<summary>FLAGS=KMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=订单号^LENGTH=20^KEYS=OrderNo^REF=CustomerOrder^VIEW=CUSTOMER_ORDER^OPTION=^ARG=^</summary>
            public const String order_no = "order_no";

            ///<summary>FLAGS=K-I-L^FORMAT=Int^DATATYPE=Number^PROMPT=行号^LENGTH=4^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String line_no = "line_no";

            ///<summary>FLAGS=K-I-L^FORMAT=Int^DATATYPE=Number^PROMPT=下达号^LENGTH=4^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String rel_no = "rel_no";

            ///<summary>FLAGS=AMIUL^FORMAT=Uppercase^DATATYPE=String^PROMPT=销售件^LENGTH=35^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String catalog_no = "catalog_no";

            ///<summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=描述^LENGTH=100^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String catalog_desc = "catalog_desc";

            ///<summary>FLAGS=AMIUL^FORMAT=Custom^DATATYPE=Number^PROMPT=数量^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String buy_qty_due = "buy_qty_due";

            ///<summary>FLAGS=AMIUL^FORMAT=Decimal(8,2)^DATATYPE=Number^PROMPT=单价^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String buy_unit_price = "buy_unit_price";

            ///<summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=供应代码^LENGTH=25^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String supply_code_db = "supply_code_db";

            ///<summary></summary>
            public const String supply_code = "supply_code";

            ///<summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>
            public const String note_text = "note_text";

            ///<summary></summary>
            public const String objid = "objid";

            ///<summary></summary>
            public const String objversion = "objversion";

        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface Icustomer_order_line
    {
       #region 属性
        /// <summary>FLAGS=KMI-L^FORMAT=Uppercase^DATATYPE=String^PROMPT=订单号^LENGTH=20^KEYS=OrderNo^REF=CustomerOrder^VIEW=CUSTOMER_ORDER^OPTION=^ARG=^</summary>

        String order_no { get; set; }


        /// <summary>FLAGS=K-I-L^FORMAT=Int^DATATYPE=Number^PROMPT=行号^LENGTH=4^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        Int32? line_no { get; set; }


        /// <summary>FLAGS=K-I-L^FORMAT=Int^DATATYPE=Number^PROMPT=下达号^LENGTH=4^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        Int32? rel_no { get; set; }


        /// <summary>FLAGS=AMIUL^FORMAT=Uppercase^DATATYPE=String^PROMPT=销售件^LENGTH=35^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        String catalog_no { get; set; }


        /// <summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=描述^LENGTH=100^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        String catalog_desc { get; set; }


        /// <summary>FLAGS=AMIUL^FORMAT=Custom^DATATYPE=Number^PROMPT=数量^LENGTH=20^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        Decimal? buy_qty_due { get; set; }


        /// <summary>FLAGS=AMIUL^FORMAT=Decimal(8,2)^DATATYPE=Number^PROMPT=单价^LENGTH=10^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        Decimal? buy_unit_price { get; set; }


        /// <summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=供应代码^LENGTH=25^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        String supply_code_db { get; set; }


        /// <summary></summary>

        String supply_code { get; set; }


        /// <summary>FLAGS=A-IUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^ARG=^</summary>

        String note_text { get; set; }


        /// <summary></summary>

        String objid { get; set; }


        /// <summary></summary>

        String objversion { get; set; }

        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值。</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}